{include file="../../../application/admin/view/public/head" /}

<style type="text/css">
    .layui-btn {
        padding: 0 8px;
    }
</style>
<div class="page-container p10">

      <div class="layui-form-item">
        <a class="layui-btn layui-btn-primary" href="{:url('index')}" data-title="{$vo.vod_name}" title="编辑">设置链接</a>
        <a class="layui-btn layui-btn-primary" href="{:url('list')}" data-title="{$vo.vod_name}" title="编辑">列表查看</a>
        <!--<a class="layui-btn layui-btn-primary" href="/app.php/tiantang/dealTiantangByOtherSetting" -->
        <!--title="编辑">全部更新</a>-->
        <a class="layui-btn layui-btn-primary" href="/app.php/tiankong/vodindex" 
        title="访问记录">访问记录</a>
      </div>
    <div class="my-toolbar-box" >
        <div class="center mb10">
            <form class="layui-form " action="{:url()}"  method="post">
                <div class="layui-input-inline">
                    <input type="text" autocomplete="off" placeholder="请输入设备ID" class="layui-input" name="device_id" value="{$param['device_id']}">
                </div>
                {if empty($param['device_id'])}
                <div class="layui-input-inline" style="width: 100px;">
                    <select class="layui-select" name="app_id">
                        <option value="">全部</option>
                        {foreach $applists as $appId =>$appName}
                        <option value="{$appId}"
                                {if $appId == $param.app_id}
                                selected
                                {/if}
                        >{$appName}</option>

                        {/foreach}
                    </select>
                </div>
                {/if}
                <button class="layui-btn mgl-20 j-search" >查询</button>
            </form>
        </div>
    </div>

     <form class="layui-form " method="post" id="pageListForm">
         <table class="layui-table" lay-size="sm">
            <thead>
            <tr>
                <th width="50">编号</th>
                <th width="250">影片名称</th>
                <th width="80">应用名称/操作系统/日志时间/设备ID</th>
            </tr>
            </thead>

            {volist name="list" id="vo"}
            <tr>
                <td class="checkifcunzai" data-id="{$vo.id}">{$vo.id}</td>
                <td><a style="width:150px;color: #2400af;" href="/app.php/tiankong/index?title={$vo.vod_name}" 
    title="编辑">{$vo.vod_name}<br/>[{$vo.vod_id}]</a></td>
                <td><div style="font-size: 10px; height: 60px;overflow-y:scroll;line-height: 15px;">{$vo.app_name}[{$vo.system_type}]<br/>{$vo.device_name}<br/>{$vo.time_added|mac_day=color}<br/>[{$vo.app_id}]<br/>{$vo.device_id}</div></td>
            </tr>
            <script>
                $.post("{:url('tiankong/checkifcunzai', ['id' => $vo['vod_id']])}",{},function(res) {
                    // console.log(res)
                    if(res.code == 1) {
                        $(".checkifcunzai[data-id='{$vo.id}']").parent().css('background', "#f1f1f1").css('border', "5px solid #ea5d00");
                    }
                },"json");
            </script>
            {/volist}
            </tbody>
        </table>

        <div id="pages" class="center"></div>

    </form>
</div>

{include file="../../../application/admin/view/public/foot" /}


<script type="text/javascript">
    var curUrl="{:url('tiankong/vodindex',$param)}";
    layui.use(['laypage', 'layer'], function() {
        var laypage = layui.laypage
                , layer = layui.layer;

        laypage.render({
            elem: 'pages'
            ,count: {$total}
            ,limit: {$limit}
            ,curr: {$page}
            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj,first){
                if(!first){
                    location.href = curUrl.replace('%7Bpage%7D',obj.curr).replace('%7Blimit%7D',obj.limit);
                }
            }
        });
    });
</script>
</body>
</html>